import os

from keras_preprocessing.image import ImageDataGenerator
from tensorboardX import SummaryWriter

image_path = os.path.join("../train")  # flower data set path
train_dir = os.path.join(image_path, "train")
validation_dir = os.path.join(image_path, "val")
train_image_generator = ImageDataGenerator(rescale=1. / 255,
                                               horizontal_flip=True)

train_data_gen = train_image_generator.flow_from_directory(directory=train_dir,
                                                           batch_size=64,
                                                           shuffle=True,
                                                           target_size=(150, 150),
                                                           class_mode='categorical')
total_train = train_data_gen.n
print(train_data_gen.class_indices)
# print(train_data_gen.filenames)

# print(next(train_data_gen))
writer = SummaryWriter("datalog")


